<!-- @author Shiyn/   huangmx 20200807优化-->
<template>
  <div class="top-right-btn">
    <el-row>
      <el-tooltip
        class="item"
        effect="dark"
        :content="showSearch ? '隐藏搜索' : '显示搜索'"
        placement="top"
        v-if="isVisibleSearch"
      >
        <el-button size="default" circle icon="Search" @click="toggleSearch()" />
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="刷新" placement="top">
        <el-button size="default" circle icon="Refresh" @click="refresh()" v-hasPermi="perm" />
      </el-tooltip>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'RightToolbar',
  props: {
    showSearch: {
      type: Boolean,
      default: true
    },
    isVisibleSearch: {
      type: Boolean,
      default: true
    },
    perm: {
      type: Array,
      required: false,
      default: () => []
    }
  },
  data() {
    return {}
  },

  methods: {
    //搜索
    toggleSearch() {
      this.$emit('update:showSearch', !this.showSearch)
    },
    //刷新
    refresh() {
      this.$emit('queryTable')
    }
  }
}
</script>
